import { ll } from "./storage";
import { message } from 'antd'

export function promisitionCB(cb: Function, role = 'admin') {
  const userInfo = ll.getItem('userInfo') || {};

  if(role !== userInfo.role) {
    return () => message.error('权限不足')
  }

  return (...args: any[]) => cb(args)
}
